<?php
class DelMenuItem extends Action {
	/*
	 * (non-PHPdoc) @see Action::execute()
	 */
	public function execute($params) {
		check_login ( ADMIN_LOGIN_PAGE );
		$miid = irqst ( 'miid' );
		if (empty ( $miid )) {
			sess_add ( 'page_tip_info', '错误的菜单项编号' );
			Response::redirect ( $this->referer );
		}
		$miM = new WebMenuItemModel ();
		$item = $miM->read ( $miid );
		$rst = $miM->delete ( $miid );
		if ($rst !== false) {
			$miM->update ( array ('up_id' => $item ['up_id'] ), array ('up_id' => $miid ) );
		} else {
			sess_add ( 'page_tip_info', '删除菜单项出错:' . $miM->last_error_msg () );
		}
		Response::redirect ( $this->referer );
	}
}